package cn.wit.luohui.day04;

import java.util.Arrays;

import org.junit.Test;

public class ArrayInversion {
	public static void main(String args[]) {
		int[] numbers1={2,8,10,12,33};
		int[] numbers2={33, 12,10, 8,2};
		reverse(numbers1); 
		System.out.println(Arrays.toString(numbers1)); 
		reverse(numbers2); 
		System.out.println(Arrays.toString(numbers2));
	} 
	@Test
	public static void reverse(int[] numbers) { 

		for (int i=0,j=numbers.length-1;i<numbers.length/2;i++,j--) { 

			int temp = numbers[i]; 

			numbers[i] = numbers[j]; 

			numbers[j] = temp;

}
	}
}
